#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Rectangle.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Rectangle)
{
	TEST(Calculate the area of rectangle)
        {
                Rectangle rectangle(2.0, 3.0);
                ASSERT_EQ(6.0, rectangle.getArea());
        }

	TEST(Calculate the area of rectangle with parameter and result adjusted_1)
        {
                Rectangle rectangle(2.3456, 3.1234);
                ASSERT_EQ(7.30, rectangle.getArea());
        }

	TEST(Calculate the area of rectangle with parameter and result adjusted_2)
        {
                Rectangle rectangle(2.345667, 3.1194);
                ASSERT_EQ(7.28, rectangle.getArea());
        }

	TEST(Calculate the area of rectangle with parameter and result adjusted_3)
        {
                Rectangle rectangle(2.345667,3.1194);

                rectangle.setLength(2.3456);
                rectangle.setWidth(3.1234);

                ASSERT_EQ(7.30, rectangle.getArea());
        }

	TEST(Calculate the area of rectangle with parameter and result adjusted_4)
        {
                Rectangle rectangle;

                rectangle.setLength(2.345667);
                rectangle.setWidth(3.1194);

                ASSERT_EQ(7.28, rectangle.getArea());
        }

	TEST(Calculate the perimeter of rectangle)
        {
                Rectangle rectangle(2.0, 3.0);
                ASSERT_EQ(10.0, rectangle.getPerimeter());
        }

	TEST(Calculate the perimeter of rectangle with parameter and result adjusted_1)
        {
                Rectangle rectangle(91.4561, 99.11156);
                ASSERT_EQ(381.12, rectangle.getPerimeter());
        }

	TEST(Calculate the perimeter of rectangle with parameter and result adjusted_2)
        {
                Rectangle rectangle(91.466001, 99.12561);
                ASSERT_EQ(381.16, rectangle.getPerimeter());
        }

	TEST(Calculate the perimeter of rectangle with parameter and result adjusted_3)
        {
                Rectangle rectangle;

                rectangle.setLength(91.4561);
                rectangle.setWidth(99.11156);

                ASSERT_EQ(381.12, rectangle.getPerimeter());
        }

	TEST(Calculate the perimeter of rectangle with parameter and result adjusted_4)
        {
                Rectangle rectangle(91.4561, 99.11156);

                rectangle.setLength(91.466001);
                rectangle.setWidth(99.12561);

                ASSERT_EQ(381.16, rectangle.getPerimeter());
        }
};
